<script>
export default {
  // 创建
  beforeCreate(){
    console.log('🟠beforeCreate');
  },
  created(){
    console.log('🟠created');
  },
  // 挂载
  beforeMount(){
    console.log('🟢beforeMount');
  },
  mounted(){
    console.log('🟢mounted');
  },
  // 更新
  beforeUpdate(){
    console.log('🟡beforeUpdate');
  },
  updated(){
    console.log('🟡updated');
  },
  // 销毁 - Vue3 改名了
  //   beforeDestory -> beforeUnmount
  //   destoryed -> unmounted
  beforeUnmount(){
    console.log('🔴beforeUnmount');
  },
  unmounted(){
    console.log('🔴unmounted');
  }
}
</script>

<template>
  <h1>生命周期函数</h1>
</template>

<style scoped>
/* 样式 */
</style>
